<template>
    <div class="account">
        <div class="Nav" @click="turnSetting">
            <van-nav-bar title="账号与安全" left-arrow />
        </div>
        <div class="safe">
            <van-cell-group title="账户与安全">
                <van-cell title="用户ID" is-link @click="myMsg" />
                <van-cell title="账户注销" is-link />
            </van-cell-group>
        </div>
    </div>
</template>
  
<script>
export default {
    name: "Account",
    data() {
        return {
            info:[],
        }
    },
      created() {
    this.getUserInfo();
  },
    methods: {
        turnSetting() {
            this.$router.push({ name: "Setting" })
        },
        myMsg(){
            this.$toast('我的用户 ID\n'+this.info.userId+'\n')
        },
             getUserInfo() {
      // 发送请求
      this.axios({
        method: "GET",
        url: "http://www.kangliuyong.com:10002/findAccountInfo",
        params: {
          appkey: this.appkey,
          tokenString:localStorage.getItem("tk__"),
        }
      }).then(res => {
        this.info = res.data.result[0];
        // console.log(this.info);
        this.info.userId = this.info.userId.split(5,10)[1];
      });
    },
    }
}
</script>
  
<style lang="postcss" scoped>
  .account{
    height: 667px;
    width: 375px;
    background-color: #f7f7f7;
  }
</style>